This patch fixes a severe bug in vtlb, where domU may face machine crash
authordjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Thu, 15 Sep 2005 16:54:16 +0000 (10:54 -0600)
committerdjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Thu, 15 Sep 2005 16:54:16 +0000 (10:54 -0600)
intermittently. Normally in page fault handler, the entry hit in vtlb shouldn't
be injected back to vtlb again, not to say meaningless -1UL. After this fix,
vtlb hit ratio also improves since guest svhpt entry may live longer.

Signed-off-by Kevin Tian <kevin.tian@intel.com>

xen/arch/ia64/xen/vcpu.c

index 8e846112f5c03f7686ffe1a5bb86b819a5bcbe9b..bbf59c579e7b4b0b930945b3bf239c4d66b18cb0 100644 (file)
@@ -1721,7 +1721,7 @@ void vcpu_itc_no_srlz(VCPU *vcpu, UINT64 IorD, UINT64 vaddr, UINT64 pte, UINT64
        // PAGE_SIZE mapping in the vhpt for now, else purging is complicated
        else vhpt_insert(vaddr,pte,PAGE_SHIFT<<2);
 #endif
-       if (IorD & 0x4) return;  // don't place in 1-entry TLB
+       if ((mp_pte == -1UL) || (IorD & 0x4)) return;  // don't place in 1-entry TLB
        if (IorD & 0x1) {
                vcpu_set_tr_entry(&PSCBX(vcpu,itlb),pte,ps<<2,vaddr);
                PSCBX(vcpu,itlb_pte) = mp_pte;